

function main( ui ) {
  var result = new JSONObject( );
  var appointment1=createAppointment("Appointment 1",
                                    "Description event...",
                                    "2011-03-24T09:00:00",
                                    "2011-03-24T18:00:00");
 var appointment2=createAppointment("Appointment 2",
                                    "Description event...",
                                    "2011-03-25T09:00:00",
                                    "2011-03-25T18:00:00");
  var appointment3=createAppointment("Appointment 3",
                                    "Description event...",
                                    "2011-03-26T09:00:00",
                                    "2011-03-26T112:00:00");
  var appointment3_2=createAppointment("Appointment 11",
                                     "Description event...",
                                     "2011-03-26T15:00:00",
                                     "2011-03-26T18:00:00");
  
  var appointment4=createAppointment("Appointment 4",
                                    "Description event...",
                                    "2011-03-27T09:00:00",
                                    "2011-03-27T18:00:00");
  var appointment4_2=createAppointment("Appointment 12",
                                     "Description event...",
                                     "2011-03-27T13:00:00",
                                     "2011-03-27T16:00:00");
  
  var appointment5=createAppointment("Appointment 5",
                                    "Description event...",
                                    "2011-03-28T09:00:00",
                                    "2011-03-28T18:00:00");
  var appointment6=createAppointment("Appointment 6",
                                    "Description event...",
                                    "2011-03-29T09:00:00",
                                    "2011-03-29T18:00:00");
  var appointment7=createAppointment("Appointment 7",
                                    "Description event...",
                                    "2011-03-30T09:00:00",
                                    "2011-03-30T18:00:00");
  var appointment8=createAppointment("Appointment 8",
                                    "Description event...",
                                    "2011-03-31T09:00:00",
                                    "2011-03-31T18:00:00");
  var appointment9=createAppointment("Appointment 9",
                                    "Description event...",
                                    "2011-03-01T09:00:00",
                                    "2011-03-01T18:00:00");
  
  result.put("appointment1", appointment1 );
  result.put("appointment2", appointment2 );
  result.put("appointment3", appointment3 );
  result.put("appointment4", appointment4 );
  result.put("appointment5", appointment5 );
  result.put("appointment6", appointment6 );
  result.put("appointment7", appointment7 );
  result.put("appointment8", appointment8 );
  result.put("appointment9", appointment9 );
  result.put("appointment10", appointment3_2 );
   result.put("appointment11", appointment4_2 );
  return result.toString();
}

function createAppointment( titleValue,descValue,startDateValue,endDateValue){

 var TITLE_JSON_KEY="TITLE";
 var DESCRIPTION_JSON_KEY="DESCRIPTION";
 var STARTDATE_JSON_KEY="STARTDATE";
 var ENDDATE_JSON_KEY="ENDDATE";

  var title = new JSONObject( );
  title.put("value",titleValue);
  
  var description = new JSONObject( );
  description.put("value",descValue);
 
  var startdate = new JSONObject( );
  startdate.put("value",startDateValue);
  
  var enddate = new JSONObject( );
  enddate.put("value",endDateValue);
 
  
  var result = new JSONObject( );
  result.put(TITLE_JSON_KEY, title );
  result.put(DESCRIPTION_JSON_KEY, description );
  result.put(STARTDATE_JSON_KEY, startdate );
  result.put(ENDDATE_JSON_KEY, enddate );
  
  return result;
}
